14. CRUD on a List of To-Dos - Part 2
ND004 C01 L07 13 CRUD On List Of Todos Part 2
Solution Code
Download here: todoapp-crud-lists-toggle.zip
Challenge yourself (optional) to complete the rest of the To-Do Lists App!
Finish implementing the ability to create, update (mark complete), and delete To-Do Lists on the app.
- Create a List : Implement a Create List form above the list of To-Do Lists, much like we did for an individual To-Do item, to enable the user to create Lists.
-
Update a List (and all of its children items)
: Implement a Checkbox next to a To-Do List, and allow the user to mark an entire list as completed. When the list is marked completed, implement the controller so that all of its child items are also marked as completed. (hint: you can use
list.todos
and what we know about bulk deletions off theQuery
object to bulk delete all todo items for a given list). -
Delete a List (and all of its children items)
: Implement an "x" remove button next to each List, and allow a user to click it in order to remove a List. When a list is removed, all of its child items should also be removed. We can set the
cascade
option to do this. See the SQLAlchemy Docs on Cascades . (Hint: you'll want to look into theall
anddelete-orphan
cascade options).
Use the solution code above as a good starting point to implement this challenge in the interactive workspace below.
Workspace
This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.
Workspace Information:
- Default file path:
- Workspace type: jupyter-lab
- Opened files (when workspace is loaded): n/a
🙌 Woo hoo!
Can you believe that we've reached the end of our development of the To-Do app? Amazing job. Give yourself a pat on the back. Do a little dance. You've finally, finally made it.
The last, and only remaining concept in this course, is handling the special case of many-to-many relationship modeling with SQLAlchemy ORM.